<!DOCTYPE html>
<link rel="stylesheet" href="{{ url_for('static', filename='css/materialize.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
<script type="text/javascript" src="{{ url_for('static', filename='js/materialize.js') }}"></script>

<title>Blockendance</title>

<body class="blue-grey lighten-4">
    <h3>Hello {{ name }}, here is the attendance data</h3>
    <br />
    <h6>Date: &emsp; {{ date }}</h6>
    <br />
    <br />
    <table>
        <thead>
            <tr>
                <th>Roll number</th>
                <th>Status</th>
            </tr>
        </thead>
        <tbody>
            {%  for i in range(1, number + 1) %}
            <tr>
                <td>{{ course }}-{{ year }}-{{ "%02d" %i }}</td>
                <td>{{ status[i - 1] }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
    <br />

    <button class="btn waves-effect waves-light" type="button" id="button" name="button">Go Back</button>
    <script type="text/javascript">
    function goBack() {
        window.open("/", "_self");
    }
    var button = document.getElementById("button");
    button.addEventListener("click", goBack);
    </script>

</body>
